package com.wanmait.heating.service.impl;

import com.github.pagehelper.PageInfo;
import com.wanmait.heating.mapper.AddressMapper;
import com.wanmait.heating.pojo.Address;
import com.wanmait.heating.service.AddressService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
@Service
@Transactional(rollbackFor = Exception.class)
public class AddressServiceImpl implements AddressService {

    @Resource
    public AddressMapper addressMapper;

    //根据用户查地址
    @Override
    public Address selectByUserinfoId(Integer userinfoId) {


        return addressMapper.selectAddressByUserinfoId(userinfoId);
    }

    @Override
    public void updateDefaultesAddress(Integer addressId) {

    }


    //增加地址
    @Override
    public void insert(Address object) {
        addressMapper.insertAddress(object);
    }



    @Override
    public void delete(Integer id) {

    }

    @Override
    public void delete(String ids) {

    }

    @Override
    public void update(Address object) {

        addressMapper.updateByPrimaryKeySelective(object);
    }

    @Override
    public Address findById(Integer id) {
        return null;
    }

    @Override
    public List<Address> findAll() {
        return null;
    }

    @Override
    public PageInfo<Address> findPage(int pageNum, int pageSize) {
        return null;
    }


}
